import { createWebHistory, createRouter } from 'vue-router'

export const routes = [
    {
        path: "/",
        redirect: "/base/Raycaster"
    },
    {
        path: '/base',
        title: "基础入门",
        children: [
            {
                path: "/base/SanYaoSu",
                title: "三要素",
                meta: { parent: "/base" },
                component: () => import("@/views/01.SanYaoSu/SanYaoSu.vue"),
            },
            {
                path: "/base/LiFangTi",
                title: "立方体",
                meta: { parent: "/base" },
                component: () => import("@/views/02.LiFangTi/LiFangTi.vue"),
            },
            {
                path: "/base/AxesHelper",
                title: "坐标轴",
                meta: { parent: "/base" },
                component: () => import("@/views/03.AxesHelper/AxesHelper.vue"),
            },
            {
                path: "/base/OrbitControls",
                title: "轨道控制器",
                meta: { parent: "/base" },
                component: () => import("@/views/04.OrbitControls/OrbitControls.vue"),
            },
            {
                path: "/base/ReSize",
                title: "场景控制器",
                meta: { parent: "/base" },
                component: () => import("@/views/05.ReSize/ReSize.vue"),
            },
            {
                path: "/base/BianHuanLiFangTi",
                title: "变换立方体",
                meta: { parent: "/base" },
                component: () => import("@/views/06.BianHuanLiFangTi/BianHuanLiFangTi.vue"),
            },
            {
                path: "/base/WuYanLiuSeLiFangTi",
                title: "五颜六色立方体",
                meta: { parent: "/base" },
                component: () => import("@/views/07.WuYanLiuSeLiFangTi/WuYanLiuSeLiFangTi.vue"),
            },
            {
                path: "/base/Sphere",
                title: "球体",
                meta: { parent: "/base" },
                component: () => import("@/views/08.Sphere/Sphere.vue"),
            },
            {
                path: "/base/DuoGeLiFangTi",
                title: "多个立方体",
                meta: { parent: "/base" },
                component: () => import("@/views/09.DuoGeLiFangTi/DuoGeLiFangTi.vue"),
            },
            {
                path: "/base/DuoGeLiFangTiXuanZhuan",
                title: "多个立方体旋转",
                meta: { parent: "/base" },
                component: () => import("@/views/10.DuoGeLiFangTiXuanZhuan/DuoGeLiFangTiXuanZhuan.vue"),
            },
            {
                path: "/base/XingNengJianShiQi",
                title: "性能监视器",
                meta: { parent: "/base" },
                component: () => import("@/views/11.XingNengJianShiQi/XingNengJianShiQi.vue"),
            },
            {
                path: "/base/DeleteLiFangTi",
                title: "删除立方体",
                meta: { parent: "/base" },
                component: () => import("@/views/12.DeleteLiFangTi/DeleteLiFangTi.vue"),
            },
            {
                path: "/base/Raycaster",
                title: "光线投射",
                meta: { parent: "/base" },
                component: () => import("@/views/13.Raycaster/Raycaster.vue"),
            },
            {
                path: "/base/MeshStandardMaterial",
                title: "标准网络材质",
                meta: { parent: "/base" },
                component: () => import("@/views/14.MeshStandardMaterial/MeshStandardMaterial.vue"),
            },
            {
                path: "/base/AmbientLight",
                title: "环境光",
                meta: { parent: "/base" },
                component: () => import("@/views/15.AmbientLight/AmbientLight.vue"),
            },
            {
                path: "/base/PointLight",
                title: "点光源",
                meta: { parent: "/base" },
                component: () => import("@/views/16.PointLight/PointLight.vue"),
            },
            {
                path: "/base/DirectionalMaterial",
                title: "平行光",
                meta: { parent: "/base" },
                component: () => import("@/views/17.DirectionalLight/DirectionalLight.vue"),
            },
            {
                path: "/base/SpotLight",
                title: "聚光源",
                meta: { parent: "/base" },
                component: () => import("@/views/18.SpotLight/SpotLight.vue"),
            },
            {
                path: "/base/LightAndShadow",
                title: "光源与阴影",
                meta: { parent: "/base" },
                component: () => import("@/views/19.LightAndShadow/LightAndShadow.vue"),
            },
            {
                path: "/base/CSS3Renderer",
                title: "CSS3渲染器",
                meta: { parent: "/base" },
                component: () => import("@/views/20.CSS3Renderer/CSS3Renderer.vue"),
            },
            {
                path: "/base/CSS2Renderer",
                title: "CSS2渲染器",
                meta: { parent: "/base" },
                component: () => import("@/views/21.CSS2Renderer/CSS2Renderer.vue"),
            },
            {
                path: "/base/Sprite",
                title: "精灵图",
                meta: { parent: "/base" },
                component: () => import("@/views/22.Sprite/Sprite.vue"),
            },
        ]
    },
    {
        path: '/demo2',
        title: "Demo2",
        component: () => import("@/views/01.SanYaoSu/SanYaoSu.vue")
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router